package com.jflame.tomcat.handler;

import com.jflame.tomcat.http.HttpServletRequest;
import com.jflame.tomcat.http.HttpServletResponse;
import com.jflame.tomcat.http.JFRequest;
import com.jflame.tomcat.http.JFResponse;

import java.io.IOException;
import java.net.Socket;
import java.util.Enumeration;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User:22954
 * Date:2024-07-21
 * Time:15:10
 */
public class JFRequestHandler implements Runnable {
    Socket socket;

    public JFRequestHandler(Socket socket) {
        this.socket = socket;
    }

    @Override
    public void run() {
        try {
            HttpServletRequest request = new JFRequest(socket.getInputStream());
            HttpServletResponse response = new JFResponse(socket.getOutputStream());
            socket.close();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
